package org.alex.nettychat.netty.custom.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.alex.nettychat.netty.custom.protocol.JoinGroupResponsePacket;
import org.alex.nettychat.netty.custom.protocol.QuitGroupResponsePacket;


/**
 * 退出群里下你响应
 *
 * @author : alex
 */
public class QuitGroupResponseHandler extends SimpleChannelInboundHandler<QuitGroupResponsePacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, QuitGroupResponsePacket responsePacket) throws Exception {
        if (responsePacket.getSuccess()) {
            System.out.println(responsePacket.getUserName() + "成功退出id为" + responsePacket.getGroupId() + "的群聊");
        }
    }
}
